/**
 * 预支账户管理
 */
app.controller('btnCtrl', ['$scope', '$http', BtnController]);
function BtnController($scope, $http){
    console.log('------$scope.menuId1-----', $scope.menuId);
    console.log('------$scope.buttonArr1-----', $scope.buttonArr);

    $scope.bindBtn = function(event) {
        var datas = $scope.getSelectedRows();
        switch(event){
            case 'event-to-add':
            {
                $scope.showModalLink('/web/account/tcwAdvanceAccount/toAdd', '新增');
                break;
            }
            case 'event-to-edit'://编辑
            {
                if(datas.length == 0) {
                    layer.alert('尚未选中数据');
                } else if(datas.length > 1) {
                    layer.alert('只能选中一行数据');
                } else {
                    $scope.showModalLink('/web/account/tcwAdvanceAccount/toEdit?id=' + datas[0].id, '编辑');
                }
                break;
            }

            case 'LAYTABLE_EXPORT_DATA':
            {
                $scope.doExport('/api/inter/tcwAdvanceAccountDetail/export');
                break;
            }

        };
    }
}


//表格双击
app.controller('dbClickCtrl', ['$scope', '$http', DbClickController]);
function DbClickController($scope, $http){
    $scope.doubleClick = function(data) {
        $scope.showModalLink('/web/account/tcwAdvanceAccount/toDetail?id=' + data.id, "预支账户管理 - 详情");
    }
}


